﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using JM.JCY.Proxy;
using JM.JCY.BusinessEntity;
using JM.JCY.Common;

namespace JM.JCY.SharePointComponent.Event.ViewEvent
{
    public partial class ViewEventUserControl : UserControl
    {
        public int _eventId
        {
            set { ViewState["_eventId"] = value; }
            get { return (int)ViewState["_eventId"]; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["EventId"] != null)
                {
                    _eventId = Int32.Parse(Request.QueryString["EventId"]);
                }
                using (EventProxy proxy = new EventProxy())
                {
                    EventDataset.T_EventDataTable eventDT = proxy.GetEventDetailById(_eventId);

                    if (eventDT.Rows.Count > 0)
                    {
                        this.lblEndDate.Text = eventDT[0].EndDate.ToString(JCYConstant.Date_Format_CN);
                        this.lblSummary.Text = eventDT[0].EventContent;
                    }

                }
            }
        }
    }
}
